﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Models;
using System.Web;
using Common;

namespace Service
{
    public abstract class IServiceMnanger
    {
        public Entities context;

        public IServiceMnanger()
        {
            try
            {
                if (HttpContext.Current.Items[SessionManager.DATABASECONNECTION] == null)
                {
                    context = new Entities();
                    HttpContext.Current.Items[SessionManager.DATABASECONNECTION] = context;
                }
                else
                {
                    context = HttpContext.Current.Items[SessionManager.DATABASECONNECTION] as Entities;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }
}
